<div class="search-res-mask"></div>
<div class="search-res">
    <div class="search-res-btn hide-pc">
        <button class="layui-btn" id="search-btn"><i class="layui-icon">&#xe615;</i>查询</button>
    </div>
    <div class="content-search search-fix">
        <div class="layui-form layui-form-pane">
            <div class="layui-inline">
                <label class="layui-form-label">登录时间</label>
                <div class="layui-input-inline" style="width:320px;">
                    <input type="text" class="layui-input" value="${timeRange}" id="timeRange" placeholder="请选择一个范围">
                </div>
            </div>
            <div class="layui-inline">
                <button class="layui-btn" id="btn_search" lay-submit="">查询</button>
                <button class="layui-btn layui-btn-primary hide-pc" id="search-close">关闭</button>
            </div>
        </div>
    </div>
</div>
<div class="tar mt10">
    <#if adminID != "">
        <a class="layui-btn layui-btn-small" href="/administrate/admin">返回</a>
    </#if>
</div>
<div class="table-list">
    <table class="layui-table layui-list-table">
        <thead>
        <tr>
            <th>管理员</th>
            <th>浏览器</th>
            <th>操作系统</th>
            <th>IP</th>
            <th>登录时间</th>
        </tr>
        </thead>
        <tbody>
        <#list data as d>
            <tr>
                <td class="layui-table-first"><i class="layui-table-hd">管理员</i><span
                        class="layui-table-bd">${d.adminName}</span></td>
                <td><i class="layui-table-hd">浏览器</i><span class="layui-table-bd">${d.browser}</span></td>
                <td><i class="layui-table-hd">操作系统</i><span class="layui-table-bd">${d.os}</span></td>
                <td><i class="layui-table-hd">IP</i><span class="layui-table-bd">${d.ip}</span></td>
                <td><i class="layui-table-hd">登录时间</i><span class="layui-table-bd">${d.logintime?string("yyyy-MM-dd HH:mm:ss")}</span>
                </td>
            </tr>
        </#list>
        </tbody>
    </table>
</div>
<!-- 分页 -->
<div id="pages" class="tac"></div>
<#macro script>
    <script>
        layui.use(['jquery', 'laypage', 'form', 'laydate'], function () {
            var $ = layui.jquery, laypage = layui.laypage, form = layui.form
                , laydate = layui.laydate;
            laydate.render({
                elem: '#timeRange'
                , type: 'datetime'
                , range: true
            });
            $(function () {
                /*弹出搜索*/
                $(document).on('click', '#search-btn', function () {
                    $('.search-res-mask').show();
                    $(this).parent().siblings('.search-fix').addClass('cur');
                });
                /*搜索*/
                $("#btn_search").on('click', function () {
                    reload(1);
                });
                /*关闭搜索*/
                $(document).on('click', '#search-close', function () {
                    $('.search-res-mask').hide();
                    $(this).parents('.search-fix').removeClass('cur');
                });
            });
            laypage.render({
                elem: 'pages'
                , layout: ['prev', 'page', 'next', 'count']
                , count: ${dataCount}
                , limit: ${pageSize}
                , curr: ${pageNo}
                , groups: 2
                , jump: function (obj, first) {
                    if (!first) {
                        reload(obj.curr)
                    }
                }
            });

            function reload(currPage) {
                var timeRange = $("#timeRange").val();
                location.href = window.location.pathname + "?adminID=${adminID}&timeRange=" + timeRange + "&pageNo=" + currPage;
            }
        });
    </script>
</#macro>